#pragma once

#include <qbprotocol/include/SSQBModel.h>

#include <map>
#include <mutex>
#include <string>
#include <unordered_map>

#include "bondlib.h"

class S_BONDLIB_EXPORT CHighYieldBond {
 public:
  static CHighYieldBond& instance();
  void ClearData();
  void UpdateData(xQBHighYieldBondListAck_c* pAck);
  bool CheckHighYieldBond(int bondIndex, const BLHCONDITION& cond);

 private:
  CHighYieldBond();
  virtual ~CHighYieldBond();
  std::string GetCombBondKey(int bondIndex) const;

 private:
  std::mutex m_mutex;
  typedef std::unordered_map<std::string, QBHighYieldBond> HighYieldBondMap;
  HighYieldBondMap m_mapHighYieldBond;
};
